package com.qidianit.mes.sys.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qidianit.mes.pojo.Material;
import com.qidianit.mes.pojo.MaterialBom;
import com.qidianit.mes.sys.mapper.MaterialBomMapper;
import com.qidianit.mes.sys.service.MaterialBomService;
import com.qidianit.mes.sys.vo.MaterialBomUtilCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: shanzhe
 * @Date: 2025/9/23 - 11:38
 */
@Service
public class MaterialBomServiceImpl implements MaterialBomService {
    @Autowired
    private MaterialBomMapper materialBomMapper;

    @Override
    public PageInfo<MaterialBomUtilCategory> selectMaterialBomByParentMaterialId(Integer pageNum, Integer pageSize, Long parentMaterialId) {
        PageHelper.startPage(pageNum,pageSize);
        List<MaterialBomUtilCategory> materialBomList = materialBomMapper.selectMaterialBomByParentMaterialId(pageNum,pageSize,parentMaterialId);
        PageInfo<MaterialBomUtilCategory> pageInfo = new PageInfo<>(materialBomList);
        return pageInfo;
    }
}
